package cn.tedu.sprig.life;

public class User {
    private String username;

    public User() {
        System.out.println("1.对象实例化,调用无参");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
        System.out.println("2.set方法给bean对象属性赋值");
    }

    public void initMethod(){
        System.out.println("3.bean对象初始化");
    }

    public void destoryMethod(){
        System.out.println("5.bean对象销毁");
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                '}';
    }
}
